package com.wsg.lightaccounting.Activity;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.wsg.lightaccounting.DB.DB;
import com.wsg.lightaccounting.Model.AccountManager;
import com.wsg.lightaccounting.Model.RecordManager;
import com.wsg.lightaccounting.R;

import java.io.IOException;
import java.text.ParseException;

public class WelcomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);

        new Handler().postDelayed(new Runnable() {
            public void run() {
                Intent mainIntent = new Intent(WelcomeActivity.this,MainActivity.class);
                WelcomeActivity.this.startActivity(mainIntent);
                RecordManager.getRecordManager(WelcomeActivity.this).getAllRecord();
                AccountManager.getAccountManager(WelcomeActivity.this).getAllAccount();
                WelcomeActivity.this.finish();
            }
        }, 2000);

    }
}
